﻿#ifndef DATAPACKAGEINFO_H
#define DATAPACKAGEINFO_H

#include <QObject>
#include <qbytearray.h>
#include <qhostaddress.h>
#include <qdatetime.h>

class DataPackageInfo :  public QObject
{
  Q_OBJECT
private://property
  QHostAddress senderAddress;
  uint senderPort;
  QHostAddress receiverAddress;
  uint receiverPort;
  uchar packageType;
  ushort msgId;
  QByteArray data;
  QDateTime createTime;
public:
  explicit DataPackageInfo(QObject *parent = nullptr);
  DataPackageInfo(const DataPackageInfo& dataPackageInfo);
signals:
public:
  QHostAddress getSenderAddress() const;
  void setSenderAddress(const QHostAddress senderAddress);
  uint getSenderPort() const;
  void setSenderPort(const uint senderPort);
  QHostAddress getReceiverAddress() const;
  void setReceiverAddress(const QHostAddress receiverAddress);
  uint getReceiverPort() const;
  void setReceiverPort(const uint receiverPort);
  uchar getPackageType() const;
  void setPackageType(const uchar packageType);
  ushort getMsgId() const;
  void setMsgId(const ushort msgId);
  QByteArray getData() const;
  void setData(const QByteArray data);
  QDateTime getCreateTime() const;
  void setCreateTime(const QDateTime createTime);
  DataPackageInfo &operator=(const DataPackageInfo &);
};

#endif // DATAPACKAGEINFO_H
